AddStategraphState('wilson',State{
    name = "webbert_whistle",
    tags = {'busy'},
    onenter = function(inst)
        inst.components.locomotor:Stop()
        inst.AnimState:PlayAnimation("whistle", false)
        inst.sg:SetTimeout(inst.AnimState:GetCurrentAnimationLength())
    end,
    timeline = {
        TimeEvent(15*FRAMES, function(inst)
            inst.SoundEmitter:PlaySound("dontstarve/common/together/houndwhistle")
        end),
        TimeEvent(30*FRAMES, function(inst)
            inst:PerformBufferedAction()
        end)
    },
    ontimeout = function(inst)
        inst.sg:GoToState("idle", true)
    end,
    events =
    {
        EventHandler("animover", function(inst)
            inst.sg:GoToState("idle")
        end),
    },
})

AddStategraphState('wilson_client',State{
    name = 'webbert_whistle',
    tags = {'busy'},
    onenter = function(inst)
        inst.components.locomotor:Stop()
        inst.AnimState:PlayAnimation("whistle", false)
        inst.sg:SetTimeout(inst.AnimState:GetCurrentAnimationLength())
        inst:PerformPreviewBufferedAction()
    end,
    ontimeout = function(inst)
        inst:ClearBufferedAction()
        inst.sg:GoToState("idle", true)
    end,
    events=
    {
        EventHandler("animover", function(inst)
            inst.sg:GoToState("idle")
        end),
    },
})
